﻿using System;
using System.Collections.Generic;
using System.Text;
using BF.Model;

namespace BF.IBLL.BaseSystem
{
    public interface Isys_PermissionBLL
    {
        /// <summary>
        /// 超级管理员获取所有模块列表
        /// </summary>
        /// <param name="roleName"></param>
        /// <returns></returns>
        List<sys_Function> GetFunctionListByAdmin();

        /// <summary>
        /// 根据角色的功能模块列表
        /// </summary>
        /// <param name="roleName"></param>
        /// <returns></returns>
        List<sys_Function> GetFunctionListByRoleName(string roleID);

        /// <summary>
        /// 根据用户获取功能模块列表
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        List<sys_Function> GetFunctionListByUserID(string userID);

        /// <summary>
        /// 根据新的功能列表ID列表设置角色的权限
        /// </summary>
        /// <param name="functionIDList"></param>
        /// <param name="roleID"></param>
        /// <param name="currentLoginName">当前操作用户，控制操作角色的子权限保持与最大权限进行联动</param>
        /// <returns></returns>
        bool SetRolePermission(List<string> functionIDList, string roleName, string currentLoginName);

        /// <summary>
        /// 根据url获取改页面的操作列表
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="url"></param>
        /// <returns></returns>
        List<sys_Function> GetFunctionListByUrl(string userName, string url);


        bool Delete(System.Linq.Expressions.Expression<Func<Model.sys_Permission, bool>> predicate);

        /// <summary>
        /// 删除角色
        /// </summary>
        /// <param name="roleName"></param>
        /// <returns></returns>
        bool DeleteRole(string roleName);
    }
}
